<template>
  <div>
    <button @click="getSchools">学生信息</button>
    <button @click="getCars">汽车信息</button>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  name: "App",
  methods: {
    getSchools(){
      axios.get('http://localhost:8080/gyl/students').then(
        response=>{
            console.log("111",response.data)
        },
        error=>{
            console.log("222",error.message)
        }
      )
    },
    getCars(){
      axios.get('http://localhost:8080/demo/cars').then(
        response=>{
            console.log("121",response.data)
        },
        error=>{
            console.log("212",error.message)
        }
      )
    }
  }

};
</script>

<style>


</style>